module.exports = {
  apps: [
    {
      name: 'child-points-system',
      script: '.output/server/index.mjs',
      instances: 2,
      exec_mode: 'cluster',
      env: {
        NODE_ENV: 'production',
        PORT: 3000,
        TZ: 'Asia/Shanghai',
        DATABASE_URL: 'mysql://root:Child@Point2024@127.0.0.1:3306/child_points',
        JWT_SECRET: 'dev-secret-20251014'
      },
      error_file: './logs/pm2-error.log',
      out_file: './logs/pm2-out.log',
      log_date_format: 'YYYY-MM-DD HH:mm:ss Z',
      merge_logs: true,
      autorestart: true,
      max_memory_restart: '500M',
      min_uptime: '10s',
      max_restarts: 10,
      restart_delay: 4000
    }
  ]
}
